﻿namespace Web.Control.WWW.Course
{
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using Model.WWW_User.Teach;
    using BLF.WWW_User.Teach;
    using Lx.Web.Common.ControlsUI;
    public class AddCourse : BaseControl
    {
        private string memberno = "";
        protected TeachModel tm;
        protected int i = 0;

        protected override void OnLoad(EventArgs e)
        {
            memberno = HttpContext.Current.User.Identity.Name;
            if (memberno == "")
            {
                Page.Response.Redirect("/user/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
                return;
            }
            tm = Teach.GetFoundCourse(memberno);
            if (tm == null||tm.MemberNo == null)
            {
                Response.End();
            }
            base.OnLoad(e);
        }
        protected string GetTLang(string TLang)
        {
            string a = "";
            if (TLang != "" && TLang != null)
            {
                a = "<option value='" + TLang + "'>" + BLF.StaticData.GetLanguageText(TLang) + "</option>";
            }
            return a;
        }
        protected string GetMotherTongue(string MotherTongue)
        {
            string a = "";
            
            if (MotherTongue != "" && MotherTongue != null)
            {   i++;
            a = "<input type='checkbox' value='" + MotherTongue + "' id='che" + i.ToString() + "' checked='checked'/><label for='che" + i.ToString() + "'>" + BLF.StaticData.GetLanguageText(MotherTongue) + "</label>";
            }
            return a;
        }
    }
}